<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  
</head>
<body>
  <div id="app">
    <button v-on:click="toggleBox('这是传递的值')">
     按钮
    </button>
    {{ msg }}
  </div>
  <script src="./vue.global.js"></script>
  <script>
    // 创建 应用实例  app （mvvm中 vm）
    const { createApp } = Vue;
    // config 参数对象
    const app = createApp({
     data(){
      return {
        msg: '你好vue'
      }
     },
      methods: {
        toggleBox(msg){
          this.msg = msg;
        }
      }
    })
    // 渲染
    app.mount('#app')
  </script>
</body>
</html>